<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function st(str){
            switch(str){
          case 'I':return 1
          case 'V':return 5
          case 'X':return 10
          case 'L':return 50
          case 'D':return 100
          case 'C':return 500
          case 'M':return 1000
      }
        }
        var a = [5,4,2,3,6,1,7]
        function fastSort(left,right,s){
            function swap(l,r){
                temp = a[l]
                a[l]=a[r]
                a[r]=temp
            }
            var first =  left
            var end = right;
            if (left >= right)
		        {return}
            var key = a[left]

            while(left<right){
            if(a[right]>=key){
                right=right-1
                continue
            }else if(a[left]<=key){
                left=left+1
                continue
            }else if(a[left]>key){
                swap(left,right)
                continue
            }

        }
        swap(first,left)
        fastSort(0,right,a)
        fastSort(right+1,end,a)
    }
    fastSort(0,a.length-1,a)
    console.log(a)
    var c= ['3','2','1','-'].toString()
    </script>
</body>
</html>